def multiplication_table(n):
    for i in range(n):
        for j in range(i + 1):
            if (j + 1) == 2 and ((i + 1) == 3 or (i + 1) == 4):
                end = "  "
            else:
                end = " "
            print("%d*%d=%d" % (j + 1, i + 1, (i + 1) * (j + 1)), end=end)
        print()  # 打换行

multiplication_table(2)



# 过程式编程
for i in range(9):
    for j in range(i + 1):
        if (j + 1) == 2 and ((i + 1) == 3 or (i + 1) == 4):
            end = "  "
        else:
            end = " "
        print("%d*%d=%d" % (j + 1, i + 1, (i + 1) * (j + 1)), end=end)
    print()  # 打换行